package py.com.solesys.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import py.com.solesys.ec.dao.impl.DaoFactory;
import py.com.solesys.ec.dto.Alumno;
import py.com.solesys.ec.dto.Padre;

/**
 * Servlet implementation class TestAlumnos
 */
public class TestAlumnos extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public TestAlumnos() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		Alumno alumno= new Alumno();
		alumno.setNombre("Carlos");
		alumno.setApellido("Bustamante");
		alumno.setEmail("cbustamantem@gmail.com");
		alumno.setDireccion("Saavedra c/ Ingabi");
		Padre mama = new Padre();
		mama.setNombre("Teresa");
		mama.setApellido("Munhoz");
		mama.setDireccion(" ");
		mama.setEmail("email@email.com");
		mama.setSexo("F");
	
		response.setContentType("text/html");
	    PrintWriter out = response.getWriter();

	    out.println("<html>");
	    out.println("<head>");
	    out.println("<title>Testing</title>");
	    out.println("</head>");
	    out.println("<body bgcolor=\"white\">");
	    
	    out.println("<h1>Agregando Mama </h1>");
		DaoFactory.getPadre().agregar(mama);
	    out.println("</body>");
	    out.println("</html>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
